<include file="Public/Header" />

<!-- right content start  -->
<div class="content-right">
	<div class="content">
		<!-- form start -->
		<form class="am-form view-list" action="{{:U('Admin/CustomView/Index')}}" method="POST">
			<div class="am-g">
				<input type="text" class="am-radius form-keyword" placeholder="{{:L('customview_so_keyword_tips')}}" name="keyword" <present name="param['keyword']"> value="{{$param.keyword}}"</present> />
				<button type="submit" class="am-btn am-btn-secondary am-btn-sm am-radius form-submit">{{:L('common_operation_query')}}</button>
				<label class="fs-12 m-l-5 c-p fw-100 more-submit">
					{{:L('common_more_screening')}}
					<input type="checkbox" name="is_more" value="1" id="is_more" <if condition="isset($param['is_more']) and $param['is_more'] eq 1">checked</if> />
					<i class="am-icon-angle-down"></i>
				</label>

				<div class="more-where <if condition="!isset($param['is_more']) or $param['is_more'] neq 1">none</if>">
					<select name="is_header" class="am-radius c-p m-t-10 param-where">
						<option value="-1">{{:L('common_view_is_header_text')}}</option>
						<foreach name="common_is_header_list" item="v">
							<option value="{{$v.id}}" <if condition="isset($param['is_header']) and $param['is_header'] eq $v['id']">selected</if>>{{$v.name}}</option>
						</foreach>
					</select>
					<select name="is_footer" class="am-radius c-p m-t-10 m-l-5 param-where">
						<option value="-1">{{:L('common_view_is_footer_text')}}</option>
						<foreach name="common_is_footer_list" item="v">
							<option value="{{$v.id}}" <if condition="isset($param['is_footer']) and $param['is_footer'] eq $v['id']">selected</if>>{{$v.name}}</option>
						</foreach>
					</select>
					<select name="is_enable" class="am-radius c-p m-t-10 m-l-5 param-where">
						<option value="-1">{{:L('common_view_enable_title')}}</option>
						<foreach name="common_is_enable_list" item="v">
							<option value="{{$v.id}}" <if condition="isset($param['is_enable']) and $param['is_enable'] eq $v['id']">selected</if>>{{$v.name}}</option>
						</foreach>
					</select>
					<div class="param-date param-where m-l-5">
						<input type="text" name="time_start" readonly="readonly" class="am-radius m-t-10" placeholder="{{:L('common_time_start_name')}}" id="time_start" <if condition="isset($param['time_start'])">value="{{$param.time_start}}"</if>/>
						<span>~</span>
						<input type="text" readonly="readonly" class="am-radius m-t-10" placeholder="{{:L('common_time_end_name')}}" name="time_end" id="time_end" <if condition="isset($param['time_end'])">value="{{$param.time_end}}"</if>/>
					</div>
				</div>
			</div>
		</form>
		<!-- form end -->

		<!-- operation start -->
		<div class="am-g m-t-15">
			<a href="{{:U('Admin/CustomView/SaveInfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> {{:L('common_operation_add')}}</a>
		</div>
		<!-- operation end -->

		<!-- list start -->
		<table class="am-table am-table-striped am-table-hover am-text-middle m-t-10">
			<thead>
				<tr>
					<th>{{:L('customview_title_text')}}</th>
					<th>{{:L('common_view_state_title')}}</th>
					<th class="am-hide-sm-only">{{:L('common_view_is_header_text')}}</th>
					<th class="am-hide-sm-only">{{:L('common_view_is_footer_text')}}</th>
					<th class="am-hide-sm-only">{{:L('common_view_is_full_screen_text')}}</th>
					<th class="am-hide-sm-only">{{:L('common_view_access_count_text')}}</th>
					<th class="am-hide-sm-only">{{:L('common_create_time_name')}}</th>
					<th>{{:L('common_more_name')}}</th>
					<th>{{:L('common_operation_name')}}</th>
				</tr>
			</thead>
			<tbody>
				<if condition="!empty($list)">
					<foreach name="list" item="v">
						<tr id="data-list-{{$v.id}}" <if condition="$v['is_enable'] eq 0">class="am-active"</if>>
							<td  class="td-title">
								<a href="{{:str_replace('admin.php', 'index.php', U('Home/CustomView/Index', array('id'=>$v['id'])))}}" target="_blank" title="{{$v.title}}">{{$v.title}}</a>
							</td>
							<td>
								<a href="javascript:;" class="am-icon-btn am-icon-check submit-state <if condition="$v['is_enable'] eq 1">am-success<else />am-default</if>" data-url="{{:U('Admin/CustomView/StateUpdate')}}" data-id="{{$v.id}}" data-state="{{$v['is_enable']}}"></a>
							</td>
							<td class="am-hide-sm-only">{{:L('common_is_header_list')[$v['is_header']]['name']}}</td>
							<td class="am-hide-sm-only">{{:L('common_is_footer_list')[$v['is_footer']]['name']}}</td>
							<td class="am-hide-sm-only">{{:L('common_is_full_screen_list')[$v['is_full_screen']]['name']}}</td>
							<td class="am-hide-sm-only">{{$v.access_count}}</td>
							<td class="am-hide-sm-only">{{$v.add_time}}</td>
							<td>
								<span class="am-icon-caret-down c-p" data-am-modal="{target: '#my-popup{{$v.id}}'}"> {{:L('common_see_more_name')}}</span>
								<div class="am-popup am-radius" id="my-popup{{$v.id}}">
									<div class="am-popup-inner">
										<div class="am-popup-hd">
											<h4 class="am-popup-title">{{:L('common_detail_content')}}</h4>
											<span data-am-modal-close
											class="am-close">&times;</span>
										</div>
										<div class="am-popup-bd">
											<dl class="dl-content">
												<dt>{{:L('customview_title_text')}}</dt>
												<dd>{{$v.title}}</dd>

												<dt>{{:L('common_view_enable_title')}}</dt>
												<dd>{{$v.is_enable_text}}</dd>

												<dt>{{:L('common_view_is_header_text')}}</dt>
												<dd>{{:L('common_is_header_list')[$v['is_header']]['name']}}</dd>

												<dt>{{:L('common_view_is_footer_text')}}</dt>
												<dd>{{:L('common_is_footer_list')[$v['is_footer']]['name']}}</dd>

												<dt>{{:L('common_view_is_full_screen_text')}}</dt>
												<dd>{{:L('common_is_full_screen_list')[$v['is_full_screen']]['name']}}</dd>

												<dt>{{:L('common_view_access_count_text')}}</dt>
												<dd>{{$v.access_count}}</dd>

												<dt>{{:L('common_create_time_name')}}</dt>
												<dd>{{$v.add_time}}</dd>

												<dt>{{:L('common_upd_time_name')}}</dt>
												<dd>{{$v.upd_time}}</dd>
											</dl>
										</div>
									</div>
								</div>
							</td>
							<td class="view-operation">
								<a href="{{:U('Admin/CustomView/SaveInfo', array('id'=>$v['id']))}}">
									<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-edit" data-am-popover="{content: '{{:L('common_operation_edit')}}', trigger: 'hover focus'}"></button>
								</a>
								<button class="am-btn am-btn-default am-btn-xs am-radius am-icon-trash-o submit-delete" data-url="{{:U('Admin/CustomView/Delete')}}" data-am-popover="{content: '{{:L('common_operation_delete')}}', trigger: 'hover focus'}" data-id="{{$v.id}}"></button>
							</td>
						</tr>
					</foreach>
				<else />
					<tr><td colspan="10" class="table-no">{{:L('common_not_data_tips')}}</td></tr>
				</if>
			</tbody>
		</table>
		<!-- list end -->

		<!-- page start -->
		<if condition="!empty($list)">
			{{$page_html}}
		</if>
		<!-- page end -->
	</div>
</div>
<!-- right content end  -->
		
<!-- footer start -->
<include file="Public/Footer" />
<!-- footer end -->